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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f0f2f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px;
}

.container.wide {
  max-width: 1000px;
}

/* ========== Header ========== */
.header {
  text-align: center;
  padding: 48px 20px 36px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  color: white;
  border-radius: 0 0 24px 24px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
  animation: headerShimmer 8s ease-in-out infinite;
}

@keyframes headerShimmer {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(10%, 5%); }
}

.header h1 {
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
  letter-spacing: 1px;
}

.header .subtitle {
  font-size: 15px;
  opacity: 0.9;
  position: relative;
}

.header .badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  margin-top: 12px;
  position: relative;
}

/* ========== Card ========== */
.card {
  background: white;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
  transition: box-shadow 0.3s;
}

.card:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.08);
}

.card h2 {
  font-size: 18px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f2f5;
  color: #1e1b4b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h2 .icon {
  font-size: 20px;
}

/* ========== Form ========== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
}

.form-group label .required {
  color: #ef4444;
  margin-left: 2px;
}

.form-group label .optional {
  color: #9ca3af;
  font-weight: 400;
  font-size: 12px;
  margin-left: 4px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.2s;
  outline: none;
  font-family: inherit;
  background: #fafafa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #6366f1;
  background: white;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.form-group textarea {
  min-height: 90px;
  resize: vertical;
}

.form-group input[type="file"] {
  width: 100%;
  padding: 12px;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.form-group input[type="file"]:hover {
  border-color: #6366f1;
  background: #f5f3ff;
}

/* ========== Buttons ========== */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  width: 100%;
  padding: 14px;
  font-size: 16px;
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.btn-success:hover {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-outline {
  background: white;
  color: #6366f1;
  border: 1.5px solid #6366f1;
}

.btn-outline:hover {
  background: #f5f3ff;
}

.btn-ghost {
  background: transparent;
  color: #6b7280;
  padding: 8px 12px;
}

.btn-ghost:hover {
  background: #f3f4f6;
  color: #374151;
}

/* ========== Messages ========== */
.message {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  display: none;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  display: block;
}

.message.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  display: block;
}

/* ========== Date & Time Selector ========== */
.date-selector-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.date-group {
  border: 1.5px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  background: white;
}

.date-group:hover {
  border-color: #c7d2fe;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.08);
}

.date-group.active {
  border-color: #6366f1;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.12);
}

.date-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: linear-gradient(135deg, #fafafe 0%, #f5f3ff 100%);
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.2s;
  user-select: none;
}

.date-group.active .date-group-header {
  background: linear-gradient(135deg, #f0ecff 0%, #ede9fe 100%);
}

.date-group-header:hover {
  background: linear-gradient(135deg, #eef0ff 0%, #ede9fe 100%);
}

.date-group-header .date-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: #1e1b4b;
}

.date-group-header .date-label .date-weekday {
  font-size: 13px;
  font-weight: 500;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 10px;
  border-radius: 12px;
}

.date-group-header .date-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 400;
  color: #6b7280;
}

.date-group-header .date-meta .slot-count {
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.date-group-header .date-meta .remaining-badge {
  background: #ecfdf5;
  color: #059669;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

.date-group-header .date-meta .remaining-badge.few {
  background: #fef3c7;
  color: #d97706;
}

.date-group-header .date-meta .remaining-badge.none {
  background: #fef2f2;
  color: #dc2626;
}

.date-group-header .arrow {
  transition: transform 0.3s ease;
  color: #9ca3af;
  font-size: 12px;
  margin-left: 8px;
}

.date-group.active .arrow {
  transform: rotate(180deg);
  color: #6366f1;
}

.time-slots {
  display: none;
  padding: 20px 24px 24px;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid #f0f0f5;
  background: #fefefe;
}

.date-group.active .time-slots {
  display: flex;
}

.time-slot-btn {
  flex: 1 1 calc(50% - 6px);
  min-width: 160px;
  max-width: calc(50% - 6px);
  padding: 16px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  background: white;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.25s ease;
  font-family: inherit;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.time-slot-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  opacity: 0;
  transition: opacity 0.25s;
}

.time-slot-btn:hover {
  border-color: #a5b4fc;
  background: linear-gradient(135deg, #faf9ff, #f5f3ff);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.time-slot-btn:hover::before {
  opacity: 1;
}

button.time-slot-btn.selected {
  border-color: #6366f1 !important;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

button.time-slot-btn.selected::before {
  opacity: 0;
}

button.time-slot-btn.selected .slot-info {
  color: rgba(255, 255, 255, 0.85) !important;
}

.time-slot-btn.full {
  opacity: 0.35;
  cursor: not-allowed;
  background: #f9fafb;
  border-style: dashed;
}

.time-slot-btn.full:hover {
  transform: none;
  box-shadow: none;
  border-color: #e5e7eb;
  background: #f9fafb;
}

.time-slot-btn .slot-time-icon {
  font-size: 18px;
  margin-bottom: 4px;
  display: block;
}

.time-slot-btn .slot-info {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
  margin-top: 6px;
}

.time-slot-btn.full .slot-info {
  color: #9ca3af;
}

/* ========== Table ========== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table th {
  background: #f8fafc;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

table tr:hover {
  background: #f8fafc;
}

table .file-link {
  color: #6366f1;
  text-decoration: none;
  font-weight: 500;
}

table .file-link:hover {
  text-decoration: underline;
}

/* ========== Star Rating ========== */
.star-rating {
  display: flex;
  gap: 4px;
  font-size: 28px;
  cursor: pointer;
  user-select: none;
}

.star-rating .star {
  color: #d1d5db;
  transition: color 0.15s, transform 0.15s;
}

.star-rating .star:hover,
.star-rating .star.active {
  color: #f59e0b;
  transform: scale(1.1);
}

.star-rating-display {
  color: #f59e0b;
  font-size: 14px;
  letter-spacing: 1px;
}

/* ========== Admin ========== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  margin-bottom: 12px;
  font-size: 14px;
  color: #6b7280;
}

.top-bar a {
  color: #6366f1;
  cursor: pointer;
  text-decoration: none;
  margin-left: 16px;
  font-weight: 500;
}

.top-bar a:hover {
  text-decoration: underline;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}

.admin-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: #64748b;
  transition: all 0.2s;
  font-family: inherit;
  text-align: center;
}

.admin-tab:hover {
  color: #334155;
}

.admin-tab.active {
  background: white;
  color: #6366f1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.admin-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.date-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 13px;
  margin: 3px;
}

.date-tag .capacity {
  color: #64748b;
  font-size: 12px;
}

.date-tag .delete-btn {
  color: #ef4444;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  border: none;
  background: none;
  padding: 0 2px;
  transition: transform 0.15s;
}

.date-tag .delete-btn:hover {
  transform: scale(1.2);
}

.stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-box {
  flex: 1;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  border: 1px solid #e2e8f0;
}

.stat-box .number {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-box .label {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.inline-form .form-group {
  margin-bottom: 0;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #9ca3af;
  font-size: 15px;
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ========== Login ========== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 44px;
  width: 380px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.login-card h2 {
  text-align: center;
  margin-bottom: 28px;
  color: #1e1b4b;
  border: none;
  padding: 0;
  font-size: 22px;
}

.login-error {
  color: #ef4444;
  font-size: 13px;
  text-align: center;
  margin-bottom: 12px;
  display: none;
}

/* ========== Modal ========== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
  background: white;
  border-radius: 16px;
  padding: 32px;
  width: 380px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal h3 {
  margin-bottom: 20px;
  font-size: 18px;
  color: #1e1b4b;
}

.pwd-msg {
  font-size: 13px;
  margin-bottom: 10px;
  display: none;
}
.pwd-msg.success { color: #059669; display: block; }
.pwd-msg.error { color: #ef4444; display: block; }

/* ========== Feedback Page ========== */
.feedback-verify {
  text-align: center;
}

.feedback-verify .phone-input-group {
  display: flex;
  gap: 10px;
  max-width: 360px;
  margin: 0 auto;
}

.feedback-verify .phone-input-group input {
  flex: 1;
}

.feedback-verify .phone-input-group .btn {
  white-space: nowrap;
  width: auto;
}

.booking-info-card {
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border: 1.5px solid #c4b5fd;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.booking-info-card .welcome {
  font-size: 18px;
  font-weight: 700;
  color: #4c1d95;
  margin-bottom: 12px;
}

.booking-info-card .info-row {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: #6d28d9;
  margin-bottom: 4px;
}

.booking-info-card .info-label {
  font-weight: 600;
  min-width: 60px;
}

.feedback-success {
  text-align: center;
  padding: 32px;
}

.feedback-success .check-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.feedback-success h3 {
  color: #059669;
  margin-bottom: 8px;
}

/* ========== Responsive ========== */
@media (max-width: 640px) {
  .header {
    padding: 36px 16px 28px;
    border-radius: 0 0 16px 16px;
  }
  .header h1 {
    font-size: 24px;
  }
  .container {
    padding: 12px;
  }
  .card {
    padding: 20px;
    border-radius: 12px;
  }
  .inline-form {
    flex-direction: column;
  }
  .stats {
    gap: 8px;
  }
  .stat-box {
    padding: 12px 8px;
  }
  .stat-box .number {
    font-size: 22px;
  }
  table {
    font-size: 13px;
  }
  table th, table td {
    padding: 8px 10px;
  }
  .login-card {
    width: calc(100% - 32px);
    padding: 32px 24px;
  }
  .feedback-verify .phone-input-group {
    flex-direction: column;
  }
  .time-slot-btn {
    flex: 1 1 100%;
    max-width: 100%;
    min-width: 0;
  }
  .date-group-header {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .date-group-header .date-meta {
    gap: 8px;
  }
  .time-slots {
    padding: 16px;
    gap: 10px;
  }
}
