:root {
  --color-primary: #0f5132;
  --color-primary-dark: #0b3d26;
  --color-accent: #c9a35c;
  --color-bg: #f5f5f4;
  --color-card: #ffffff;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-success: #16a34a;
  --color-warning: #f59e0b;
  --color-danger: #dc2626;
  --color-info: #2563eb;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #e5e5e5;
  color: var(--color-text);
}
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; }

.role-switch-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--color-primary-dark); padding: 10px 20px;
}
.role-tabs { display: flex; gap: 8px; }
.role-tab {
  background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.8);
  padding: 8px 16px; border-radius: 8px; font-size: 13px; transition: all .15s;
}
.role-tab-active { background: var(--color-accent); color: var(--color-primary-dark); font-weight: 600; }
.reset-btn { background: transparent; border: 1px solid rgba(255,255,255,0.4); color: #fff; padding: 6px 12px; border-radius: 8px; font-size: 12px; }

.phone-frame { display: flex; justify-content: center; padding: 32px 16px; min-height: calc(100vh - 56px); }
.phone-shell { width: 375px; background: #111; padding: 10px; border-radius: 36px; box-shadow: 0 20px 40px rgba(0,0,0,.35); }
.phone-screen { background: var(--color-bg); border-radius: 26px; overflow: hidden; display: flex; flex-direction: column; height: 780px; }
.phone-statusbar { height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; font-size: 13px; font-weight: 600; background: var(--color-primary); color: #fff; }
.phone-content { flex: 1; overflow-y: auto; padding: 16px; }
.phone-tabbar { height: 58px; flex-shrink: 0; display: flex; border-top: 1px solid #e5e7eb; background: #fff; }
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--color-text-muted); }
.tab-item-active { color: var(--color-primary); font-weight: 600; }

.admin-frame { min-height: calc(100vh - 56px); }
.admin-shell { display: flex; min-height: calc(100vh - 56px); }
.admin-sidebar { width: 210px; background: var(--color-primary-dark); color: #fff; flex-shrink: 0; }
.admin-logo { padding: 20px 16px; font-weight: 700; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.1); }
.admin-sidebar-item { padding: 14px 20px; font-size: 14px; color: rgba(255,255,255,.75); cursor: pointer; }
.admin-sidebar-item-active { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; border-left: 3px solid var(--color-accent); }
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar { height: 56px; flex-shrink: 0; background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; font-size: 14px; }
.admin-content { padding: 24px; flex: 1; background: var(--color-bg); overflow-y: auto; }

.card { background: var(--color-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.section-title { font-size: 15px; font-weight: 600; margin: 16px 0 8px; }
.empty-state { text-align: center; color: var(--color-text-muted); padding: 40px 0; font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border-radius: 10px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-accent { background: var(--color-accent); color: #1f2937; }
.btn-ghost { background: transparent; border: 1px solid #d1d5db; color: var(--color-text); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-online { background: #dcfce7; color: #166534; }
.badge-offline { background: #e5e7eb; color: #4b5563; }
.badge-serving { background: #ffedd5; color: #c2410c; }
.badge-invited { background: #dbeafe; color: #1e40af; }
.badge-pending { background: #fef9c3; color: #854d0e; }
.badge-accepted { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #fee2e2; color: #b91c1c; }
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 13px; color: var(--color-text-muted); margin-bottom: 4px; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; background: #fff; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid #d1d5db; font-size: 12px; background: #fff; }
.chip-selected { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.avatar { border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; flex-shrink: 0; }
.photo-placeholder { aspect-ratio: 1; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 26px; color: #fff; }
.page-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.page-tab { flex: 1; text-align: center; padding: 8px; border-radius: 8px; background: #fff; font-size: 13px; color: var(--color-text-muted); }
.page-tab-active { background: var(--color-primary); color: #fff; font-weight: 600; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; color: var(--color-text-muted); font-weight: 500; padding: 8px; border-bottom: 1px solid #e5e7eb; }
.admin-table td { padding: 8px; border-bottom: 1px solid #f1f1f1; vertical-align: middle; }

#toast-container { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1f2937; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; opacity: 0; transform: translateY(-8px); transition: all .2s; }
.toast-visible { opacity: 1; transform: translateY(0); }
.toast-success { background: #166534; }
.toast-error { background: #b91c1c; }
.toast-info { background: #1f2937; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 9998; }
.modal-box { background: #fff; border-radius: 12px; padding: 20px; width: 300px; max-height: 80vh; overflow-y: auto; }
.modal-message { font-size: 14px; margin-bottom: 16px; }
.modal-body { font-size: 13px; line-height: 1.8; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
