/* ============================================================
   飯聚聚 Fanjuju Ops admin — desktop 1280×800 chrome
   Single muted palette · gray scale + #2563EB accent
   NO brand gold (gold is user-facing only)
   ============================================================ */

body.ops {
  background: #DCDFE4;
  color: #1A1F2B;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Noto Sans TC", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding: 32px 16px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.ops .doc-head,
body.ops .doc-foot,
body.ops .doc-nav { width: 1280px; max-width: 100%; }

body.ops .doc-foot { padding-top: 12px; }

.ops-stage {
  width: 1280px;
  max-width: 100%;
}

/* ---------- Frame ---------- */
.ops-frame {
  width: 1280px;
  height: 800px;
  background: #F5F6F8;
  color: #1A1F2B;
  display: grid;
  grid-template-rows: 56px 1fr;
  grid-template-columns: 240px 1fr;
  grid-template-areas:
    "top top"
    "side main";
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 12px 32px rgba(0,0,0,0.10);
  font-family: inherit;
}

.ops-frame * { box-sizing: border-box; }

/* ---------- Top bar ---------- */
.ops-top {
  grid-area: top;
  background: #FFFFFF;
  border-bottom: 1px solid #E4E7EC;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 24px;
}
.ops-top .ops-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700;
  color: #1A1F2B;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}
.ops-top .ops-logo svg {
  width: 24px; height: 24px;
  color: #1A1F2B;       /* neutral, not gold */
  display: block;
}
.ops-top .ops-logo small {
  color: #98A0AE;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: 2px;
}
.ops-top .ops-crumb {
  font-size: 13px;
  color: #5A6577;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.ops-top .ops-crumb > span:not(.sep) { white-space: nowrap; }
.ops-top .ops-crumb .sep {
  color: #C1C7D0;
  font-size: 14px;
  line-height: 1;
}
.ops-top .ops-crumb .leaf { color: #1A1F2B; font-weight: 600; }
.ops-top .ops-actions {
  margin-left: auto;
  display: flex; align-items: center; gap: 14px;
}
.ops-top .admin-email {
  font-size: 13px;
  color: #5A6577;
  font-variant-numeric: tabular-nums;
}
.ops-top .icon-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid #E4E7EC;
  background: #FFFFFF;
  color: #5A6577;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ops-top .icon-btn:hover { background: #F4F7FB; color: #1A1F2B; }

/* ---------- Sidebar ---------- */
.ops-side {
  grid-area: side;
  background: #FFFFFF;
  border-right: 1px solid #E4E7EC;
  padding: 14px 12px;
  overflow-y: auto;
}
.ops-nav-group + .ops-nav-group { margin-top: 14px; }
.ops-nav-group-h {
  font-size: 10px;
  font-weight: 700;
  color: #98A0AE;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 6px 10px 4px;
}
.ops-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: #1A1F2B;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-bottom: 1px;
  transition: background 0.12s ease;
  white-space: nowrap;
}
.ops-nav-item > span:not(.dot):not(.badge-n) { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.ops-nav-item:hover { background: #F4F7FB; }
.ops-nav-item.active {
  background: #EEF3FF;
  color: #2563EB;
  font-weight: 600;
  border-left-color: #2563EB;
}
.ops-nav-item .dot {
  width: 4px; height: 4px;
  border-radius: 9999px;
  background: #C1C7D0;
  flex-shrink: 0;
}
.ops-nav-item.active .dot { background: #2563EB; }
.ops-nav-item .badge-n {
  margin-left: auto;
  font-size: 10px;
  background: #DC2626;
  color: #FFFFFF;
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Main ---------- */
.ops-main {
  grid-area: main;
  overflow-y: auto;
  padding: 20px 24px 32px;
}

/* ---------- Page header ---------- */
.page-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.page-h h1 {
  font-size: 20px;
  font-weight: 700;
  color: #1A1F2B;
  letter-spacing: -0.005em;
  margin: 0;
}
.page-h .sub {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #98A0AE;
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.page-h .right { display: flex; align-items: center; gap: 8px; }

/* ---------- Card ---------- */
.ops-card {
  background: #FFFFFF;
  border: 1px solid #E4E7EC;
  border-radius: 10px;
  overflow: hidden;
}
.ops-card .card-h {
  padding: 12px 16px;
  border-bottom: 1px solid #EEF0F3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ops-card .card-h h3 {
  font-size: 13px;
  font-weight: 700;
  color: #1A1F2B;
  margin: 0;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.ops-card .card-body { padding: 16px; }

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: #EEF0F3;
  border: 1px solid #E4E7EC;
  border-radius: 10px;
  overflow: hidden;
}
.kpi {
  background: #FFFFFF;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi .label {
  font-size: 11px;
  color: #98A0AE;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.kpi .value {
  font-size: 22px;
  font-weight: 700;
  color: #1A1F2B;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.kpi .delta {
  font-size: 11px;
  color: #5A6577;
  font-variant-numeric: tabular-nums;
}
.kpi .delta.up { color: #16A34A; }
.kpi .delta.down { color: #DC2626; }

/* ---------- Tables ---------- */
.ops-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  background: #FFFFFF;
}
.ops-table thead th {
  background: #FAFBFC;
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #5A6577;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid #E4E7EC;
  border-top: 1px solid #E4E7EC;
  white-space: nowrap;
}
.ops-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #EEF0F3;
  color: #1A1F2B;
  vertical-align: middle;
  white-space: nowrap;
}
.ops-table tbody tr:hover td { background: #F8FAFC; }
.ops-table tbody tr.danger td { background: #FEF6F6; }
.ops-table tbody tr.danger:hover td { background: #FCEFEF; }
.ops-table .num { font-variant-numeric: tabular-nums; text-align: right; }
.ops-table .muted { color: #5A6577; }
.ops-table .faint { color: #98A0AE; }
.ops-table .strong { font-weight: 600; }
.ops-table .id { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: #5A6577; }
.ops-table a.link { color: #2563EB; font-weight: 600; }
.ops-table a.link:hover { text-decoration: underline; }
.ops-table a.link.danger { color: #DC2626; }

/* ---------- Filter chip row ---------- */
.filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 9999px;
  border: 1px solid #E4E7EC;
  background: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  color: #5A6577;
  cursor: pointer;
  white-space: nowrap;
}
.filter-chip:hover { background: #F4F7FB; }
.filter-chip[aria-pressed="true"] {
  background: #EEF3FF;
  color: #2563EB;
  border-color: #BCD0FF;
}
.filter-chip .count {
  background: rgba(0,0,0,0.06);
  color: inherit;
  padding: 0 6px;
  border-radius: 9999px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.filter-chip[aria-pressed="true"] .count {
  background: rgba(37,99,235,0.16);
}

/* ---------- Buttons ---------- */
.ops-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid #2563EB;
  background: #2563EB;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease;
  white-space: nowrap;
}
.ops-btn:hover { background: #1D54CC; }
.ops-btn.lg { height: 36px; padding: 0 16px; font-size: 14px; }
.ops-btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }

.ops-btn-secondary {
  background: #FFFFFF;
  color: #1A1F2B;
  border: 1px solid #E4E7EC;
}
.ops-btn-secondary:hover { background: #F4F7FB; }

.ops-btn-danger {
  background: #DC2626;
  border-color: #DC2626;
  color: #FFFFFF;
}
.ops-btn-danger:hover { background: #B91C1C; }

.ops-btn-amber {
  background: #D97706;
  border-color: #D97706;
  color: #FFFFFF;
}
.ops-btn-amber:hover { background: #B45309; }

.ops-btn-success {
  background: #16A34A;
  border-color: #16A34A;
  color: #FFFFFF;
}
.ops-btn-success:hover { background: #12873B; }

.ops-btn-ghost {
  background: transparent;
  color: #5A6577;
  border: 1px solid transparent;
}
.ops-btn-ghost:hover { background: #F4F7FB; color: #1A1F2B; }

.ops-btn-outline-danger {
  background: #FFFFFF;
  color: #DC2626;
  border: 1px solid #DC2626;
}
.ops-btn-outline-danger:hover { background: #FEF2F2; }

/* ---------- Inputs ---------- */
.ops-input,
.ops-select,
.ops-textarea {
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid #E4E7EC;
  background: #FFFFFF;
  color: #1A1F2B;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  width: 100%;
}
.ops-input:focus,
.ops-select:focus,
.ops-textarea:focus { border-color: #2563EB; box-shadow: 0 0 0 3px #EEF3FF; }
.ops-input::placeholder { color: #98A0AE; }
.ops-textarea {
  height: auto;
  min-height: 80px;
  padding: 8px 10px;
  resize: vertical;
  line-height: 1.5;
}
.ops-select { padding-right: 28px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #5A6577 50%), linear-gradient(135deg, #5A6577 50%, transparent 50%); background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.ops-input.search {
  padding-left: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2398A0AE' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'%3E%3C/circle%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}
.ops-input.lg, .ops-select.lg { height: 36px; font-size: 14px; }

.ops-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ops-field-label {
  font-size: 12px;
  font-weight: 600;
  color: #5A6577;
}
.ops-field-hint {
  font-size: 12px;
  color: #98A0AE;
}
.ops-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---------- Toggle switch ---------- */
.ops-switch {
  display: inline-block;
  width: 36px;
  height: 20px;
  border-radius: 9999px;
  background: #C1C7D0;
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
  vertical-align: middle;
  flex-shrink: 0;
}
.ops-switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #FFFFFF;
  border-radius: 9999px;
  transition: left 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}
.ops-switch[aria-checked="true"] { background: #16A34A; }
.ops-switch[aria-checked="true"]::after { left: 18px; }

/* ---------- Status badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge .pip {
  width: 6px; height: 6px;
  border-radius: 9999px;
  background: currentColor;
}
.badge.success { background: #ECFDF5; color: #16A34A; }
.badge.warn    { background: #FFFBEB; color: #D97706; }
.badge.danger  { background: #FEF2F2; color: #DC2626; }
.badge.info    { background: #EEF3FF; color: #2563EB; }
.badge.neutral { background: #F0F2F5; color: #5A6577; }
.badge.gold    { background: #FFF7E6; color: #92571B; }
.badge.premium { background: #1A0F26; color: #C9A961; }

/* ---------- Avatar ---------- */
.ops-avatar {
  border-radius: 9999px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  background:
    radial-gradient(at 30% 30%, #FFE4B0 0%, transparent 60%),
    linear-gradient(135deg, #C9A961, #2E7D32);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.ops-avatar.sm { width: 28px; height: 28px; }
.ops-avatar.md { width: 40px; height: 40px; }
.ops-avatar.lg { width: 64px; height: 64px; }

/* Avatar variants */
.ops-avatar.v2 { background: radial-gradient(at 60% 40%, #DFF0E3 0%, transparent 70%), linear-gradient(135deg, #6BA08C, #2E7D32); }
.ops-avatar.v3 { background: radial-gradient(at 20% 70%, #FFD9C9 0%, transparent 60%), linear-gradient(135deg, #F9A825, #C9A961); }
.ops-avatar.v4 { background: radial-gradient(at 70% 20%, #C4D9FF 0%, transparent 60%), linear-gradient(135deg, #2563EB, #6BA08C); }
.ops-avatar.v5 { background: radial-gradient(at 40% 60%, #FFD3E0 0%, transparent 60%), linear-gradient(135deg, #A78BFA, #C9A961); }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 12px;
  color: #5A6577;
  border-top: 1px solid #EEF0F3;
}
.pagination .pages { display: flex; gap: 4px; }
.pagination .pg-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid #E4E7EC;
  background: #FFFFFF;
  color: #5A6577;
  font-size: 12px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.pagination .pg-btn[aria-current="page"] {
  background: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
  font-weight: 700;
}

/* ---------- Tabs ---------- */
.ops-tabs {
  display: flex;
  border-bottom: 1px solid #E4E7EC;
  gap: 4px;
  padding: 0 4px;
}
.ops-tabs button {
  background: transparent;
  border: none;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #5A6577;
  cursor: pointer;
  position: relative;
  font-family: inherit;
  white-space: nowrap;
}
.ops-tabs button[aria-pressed="true"] {
  color: #2563EB;
}
.ops-tabs button[aria-pressed="true"]::after {
  content: '';
  position: absolute;
  left: 6px; right: 6px;
  bottom: -1px;
  height: 2px;
  background: #2563EB;
  border-radius: 9999px;
}
.ops-tabs button .count {
  background: #F0F2F5;
  padding: 0 7px;
  border-radius: 9999px;
  font-size: 11px;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}
.ops-tabs button[aria-pressed="true"] .count { background: #EEF3FF; color: #2563EB; }

/* ---------- Section heading ---------- */
.ops-section-h {
  font-size: 11px;
  font-weight: 700;
  color: #98A0AE;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 16px 0 8px;
}

/* ---------- Tier chip (User 360) ---------- */
.tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tier-chip.standard { background: #F0F2F5; color: #1A1F2B; }
.tier-chip.premium { background: #1A0F26; color: #C9A961; }

/* ---------- Helpers ---------- */
.flex { display: flex; }
.col { flex-direction: column; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.grow { flex: 1; min-width: 0; }
.center { align-items: center; }
.right { margin-left: auto; }
