/* Bảng điều khiển SUPER_ADMIN - Đồng bộ 5 theme & tối ưu màn hình Android */
.admin-wrap {
  display: grid;
  gap: 16px;
}

.admin-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-header h1 {
  font-size: clamp(22px, 2.2vw, 32px);
}

.admin-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--tint, #eef5f0);
  scrollbar-width: thin;
}

.admin-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-tab.active {
  background: var(--paper);
  color: var(--green);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.09);
}

[data-theme="luxury"] .admin-tab.active {
  color: var(--deep);
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
}

.admin-kpi {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: grid;
  gap: 5px;
}

.admin-kpi-label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 570;
}

.admin-kpi-val {
  font-size: clamp(20px, 1.8vw, 28px);
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--ink);
}

.admin-kpi-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.admin-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  display: grid;
  gap: 12px;
}

.admin-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--tint, #e8efe9);
  overflow: hidden;
  border: 1px solid var(--line);
}

.admin-progress > i {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.admin-chart {
  width: 100%;
  height: 180px;
  display: block;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-toolbar input,
.admin-toolbar select {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13.5px;
  min-width: 0;
}

.admin-toolbar select {
  padding-right: 30px;
}

.admin-toolbar input[type="search"],
.admin-toolbar input[type="text"] {
  flex: 1 1 200px;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.admin-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.admin-table-wrap th,
.admin-table-wrap td {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.admin-table-wrap thead th {
  border-top: 0;
  font-size: 12px;
  background: var(--tint, #f4f7f5);
  color: var(--muted);
}

.admin-table-wrap tbody tr {
  cursor: default;
}

.status-pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.status-pill.ACTIVE {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.status-pill.LOCKED {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.status-pill.DISABLED {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.admin-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--tint, #f7faf8);
}

.admin-switch-row strong {
  display: block;
  font-size: 14px;
}

.admin-switch-row small {
  color: var(--muted);
  font-size: 12.5px;
}

.admin-switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.admin-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.admin-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #9ca3af;
  border-radius: 999px;
  transition: 0.2s;
}

.admin-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.admin-switch input:checked + .admin-slider {
  background: var(--green);
}

.admin-switch input:checked + .admin-slider::before {
  transform: translateX(20px);
}

.trend-up {
  color: #15803d;
  font-weight: 650;
}

.trend-down {
  color: #b91c1c;
  font-weight: 650;
}

[data-theme="luxury"] .trend-up {
  color: #86efac;
}

[data-theme="luxury"] .trend-down {
  color: #fca5a5;
}

.admin-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

@media (max-width: 600px) {
  .admin-panel {
    padding: 14px 12px;
  }
  .admin-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .admin-kpi {
    padding: 11px 12px;
  }
  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-toolbar input,
  .admin-toolbar select,
  .admin-toolbar button {
    width: 100%;
  }
}

/* Chọn nhiều thành viên & mức độ ưu tiên tin nhắn */
.recipient-picker {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--tint, #f7faf8);
  display: grid;
  gap: 8px;
  margin: 8px 0;
}

.recipient-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--green);
  font-size: 12px;
  font-weight: 600;
}

.recipient-chip button {
  border: 0;
  background: transparent;
  padding: 0 2px;
  font-size: 13px;
  line-height: 1;
  color: var(--muted);
}

.recipient-list {
  max-height: 185px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
}

.recipient-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.recipient-option:hover {
  background: var(--tint, #f1f6f2);
}

.recipient-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.priority-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.priority-pill.important {
  background: #fee2e2;
  color: #b91c1c;
}

.priority-pill.normal {
  background: var(--tint, #eef3ef);
  color: var(--muted);
}
